﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Data;
using LYWebsite.Models;

namespace LYWebsite.Helper
{
    public class UserHelper
    {
        public static User UserModelBuilder(FormCollection form)
        {
            var username = form["UserName"];
            var phoneNum = form["PhoneNumber"];
            int carId;
            int.TryParse(form["CarType"], out carId);
            var carType = carId;
            var user=new User
            {
                UserName = username,
                OpenId = phoneNum,
                CarId = carId,
            };
            return user;
        }
    }
}